<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FreeRTOS Addons: cpp_freertos::Tasklet Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FreeRTOS Addons
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacecpp__freertos.html">cpp_freertos</a></li><li class="navelem"><a class="el" href="classcpp__freertos_1_1_tasklet.html">Tasklet</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classcpp__freertos_1_1_tasklet-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">cpp_freertos::Tasklet Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div></div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="tasklet_8hpp_source.html">tasklet.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac93ae2fb44c610c01aaab63614558f76"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_tasklet.html#ac93ae2fb44c610c01aaab63614558f76">Tasklet</a> ()</td></tr>
<tr class="separator:ac93ae2fb44c610c01aaab63614558f76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c2a164589ed36c3bf8e63aaa39fa4a4"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_tasklet.html#a1c2a164589ed36c3bf8e63aaa39fa4a4">~Tasklet</a> ()</td></tr>
<tr class="separator:a1c2a164589ed36c3bf8e63aaa39fa4a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5255e30f9d073f6da4044318d0d65136"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_tasklet.html#a5255e30f9d073f6da4044318d0d65136">Schedule</a> (uint32_t parameter, TickType_t CmdTimeout=portMAX_DELAY)</td></tr>
<tr class="separator:a5255e30f9d073f6da4044318d0d65136"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cbb17881f3cb7a69450bc65743da56b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_tasklet.html#a4cbb17881f3cb7a69450bc65743da56b">ScheduleFromISR</a> (uint32_t parameter, BaseType_t *pxHigherPriorityTaskWoken)</td></tr>
<tr class="separator:a4cbb17881f3cb7a69450bc65743da56b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a9ba0353e9cb64d956395803fbd7cb409"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_tasklet.html#a9ba0353e9cb64d956395803fbd7cb409">CheckForSafeDelete</a> ()</td></tr>
<tr class="separator:a9ba0353e9cb64d956395803fbd7cb409"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51f3ebc518a938f616392d47d61f5eda"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_tasklet.html#a51f3ebc518a938f616392d47d61f5eda">Run</a> (uint32_t parameter)=0</td></tr>
<tr class="separator:a51f3ebc518a938f616392d47d61f5eda"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >A FreeRTOS wrapper for its concept of a Pended Function. In Linux, one permutation of this would be a <a class="el" href="classcpp__freertos_1_1_tasklet.html">Tasklet</a>, or bottom half processing from an ISR.</p>
<p >This is an abstract base class. To use this, you need to subclass it. All of your Tasklets should be derived from the <a class="el" href="classcpp__freertos_1_1_tasklet.html">Tasklet</a> class. Then implement the virtual Run function. This is a similar design to Java threading. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ac93ae2fb44c610c01aaab63614558f76" name="ac93ae2fb44c610c01aaab63614558f76"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac93ae2fb44c610c01aaab63614558f76">&#9670;&#160;</a></span>Tasklet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Tasklet::Tasklet </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Constructor </p><dl class="section note"><dt>Note</dt><dd>Do not construct inside an ISR! This includes creating local instances of this object. </dd></dl>

</div>
</div>
<a id="a1c2a164589ed36c3bf8e63aaa39fa4a4" name="a1c2a164589ed36c3bf8e63aaa39fa4a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c2a164589ed36c3bf8e63aaa39fa4a4">&#9670;&#160;</a></span>~Tasklet()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Tasklet::~Tasklet </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >Destructor </p><dl class="section note"><dt>Note</dt><dd>Do not delete inside an ISR! This includes the automatic deletion of local instances of this object when leaving scope. </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a9ba0353e9cb64d956395803fbd7cb409" name="a9ba0353e9cb64d956395803fbd7cb409"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9ba0353e9cb64d956395803fbd7cb409">&#9670;&#160;</a></span>CheckForSafeDelete()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Tasklet::CheckForSafeDelete </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >You must call this in your dtor, to synchronize between being called and being deleted. </p>

</div>
</div>
<a id="a51f3ebc518a938f616392d47d61f5eda" name="a51f3ebc518a938f616392d47d61f5eda"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51f3ebc518a938f616392d47d61f5eda">&#9670;&#160;</a></span>Run()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cpp_freertos::Tasklet::Run </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>parameter</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >Implementation of your actual tasklet code. You must override this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parameter</td><td>Value passed to you from the <a class="el" href="classcpp__freertos_1_1_tasklet.html#a5255e30f9d073f6da4044318d0d65136">Schedule()</a> methods. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a5255e30f9d073f6da4044318d0d65136" name="a5255e30f9d073f6da4044318d0d65136"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5255e30f9d073f6da4044318d0d65136">&#9670;&#160;</a></span>Schedule()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Tasklet::Schedule </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>parameter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TickType_t&#160;</td>
          <td class="paramname"><em>CmdTimeout</em> = <code>portMAX_DELAY</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Schedule this <a class="el" href="classcpp__freertos_1_1_tasklet.html">Tasklet</a> to run.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parameter</td><td>Value passed to your Run method. </td></tr>
    <tr><td class="paramname">CmdTimeout</td><td>How long to wait to send this command to the timer daemon. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if this command will be sent to the timer daemon, false if it will not (i.e. timeout). </dd></dl>

</div>
</div>
<a id="a4cbb17881f3cb7a69450bc65743da56b" name="a4cbb17881f3cb7a69450bc65743da56b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4cbb17881f3cb7a69450bc65743da56b">&#9670;&#160;</a></span>ScheduleFromISR()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Tasklet::ScheduleFromISR </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>parameter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">BaseType_t *&#160;</td>
          <td class="paramname"><em>pxHigherPriorityTaskWoken</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Schedule this <a class="el" href="classcpp__freertos_1_1_tasklet.html">Tasklet</a> to run from ISR context. This allows FreeRTOS ISRs to defer processing from the ISR into a task context.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parameter</td><td>Value passed to your Run method. </td></tr>
    <tr><td class="paramname">pxHigherPriorityTaskWoken</td><td>Did this operation result in a rescheduling event. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if this command will be sent to the timer daemon, false if it will not (i.e. timeout). </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="tasklet_8hpp_source.html">tasklet.hpp</a></li>
<li>src/freertos-addon/c++/ctasklet.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
